<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var Array4 = [99, 33, 45, 3, 2, 778, 999];
        var max = Array4[0];
        for (var i = 1; i < Array4.length; i++) {
            if (Array4[i] > max) {
                max = Array4[i];
            }
        }
        console.log(max);
    </script>
</head>

<body>

</body>

</html>